<template>
  <div class="title">
    {{ title }}
    <el-button @click="openform">弹框</el-button>
    <el-button @click="changeUser">改变username</el-button>
    <span class="test">test</span>
  </div>
</template>

<script>
import { mapState,mapActions } from 'vuex'
export default {
  data () {
    return {
      title: '测试'
    };
  },
  created () {
    console.log(this.$store)
    console.log(this.userInfos)
  },
  methods: {
    ...mapActions('user',['setUserInfos']),
    changeUser(){
      this.setUserInfos({username: '李四'})
      console.log(this.userInfos)
    },
    openform(){
      $.form.sidepage(ELMP.resource('vue/components/dialog.vue','tmzk_test'))
    }
  },
  computed: {
    ...mapState('user',['userInfos'])
  }
};
</script>

<style scoped lang="less">
.title {
  .test {
    color: green;
  }
}
</style>